package com.mrjy.activity.controller;
import java.util.HashMap;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.activity.bo.IActivitySignupInfoBo;
import com.mrjy.activity.dto.ActivitySelectDTO;
import com.mrjy.common.entity.ActivityInfo;
import com.mrjy.common.entity.ActivitySignupInfo;
import com.mrjy.common.entity.UserInfo;
import com.mrjy.common.enums.ResultEnum;
import com.mrjy.common.exception.InnerException;
import com.mrjy.common.util.GlobalConstant;


@Controller
@RequestMapping("/activity/signup")
public class ActivitySignUpInfoController {
	@Resource
	private IActivitySignupInfoBo activitySignupInfoBo;
	
	private static Logger Logger = LoggerFactory.getLogger(ActivitySignUpInfoController.class);
	
	
	
	/**
	 * 通过用户id和活动查询其已报记录  --微信前端
	 * @return
	 */
	@RequestMapping(value="/list",method=RequestMethod.GET)
	@ResponseBody
	public Object list(ActivitySignupInfo info,HttpSession session) {
		UserInfo loginUser = (UserInfo) session.getAttribute(GlobalConstant.USER_INFO);
		if(null == loginUser ){
			throw new InnerException(ResultEnum.NOT_LOGIN);
		}
		info.setUserId(loginUser.getId());
		return activitySignupInfoBo.selectListByUserIdAndActId(info);
	}
	
	
	
}
